<include file="Inc/html_header" />

<style type="text/css">
    ul,li{ list-style:none; margin:0; padding:0; }
    .tabs li{ float:left; display:inline-block; padding:6px 10px; font-size:14px; background-color:#ccc; cursor:pointer; color:#777777; }
    .tabs li.current{ background-color:#449f47; color:#fff; }
    .notice{ background-color:#e89014; color:#fff;}
</style>

<form name="myForm" id="myForm" action="" method="post" enctype="multipart/form-data" />
    <table style="width:100%;">
        <tr>
            <td>
                <ul class="tabs" id="tabs">
                    <?php if( ! empty($cate)){ $ix = 1; foreach($cate as $v){ ?>
                    <li onclick="goTab(1, <?php echo $ix;?>)" id="tt_1_<?php echo $ix;?>" class="tt_1 <?php if($ix === 1){ echo 'current'; }?>"><?php echo $v['title'];?></li>
                    <?php $ix++; }}?>
                </ul>
            </td>
            <td class="text-right"><a class="btn btn-info" href="<?php echo U('config/add');?>"><i class="icon icon-plus"></i> 添加配置</a></td>
        </tr>
    </table>
    <div style="clear:both; height:3px;"></div>
    <ul id="tab_content_box">
        <?php if( ! empty($cate)){ $ix = 1; foreach($cate as $v){ ?>
        <li class="tab_con tc_1" id="tc_1_<?php echo $ix;?>" <?php if($ix > 1){ echo 'style="display:none;"'; }?>>
            <?php if(empty($v['options'])){ echo '...'; }else{ ?>
                <table class="table table-bordered table-hover">
                    <tbody>
                    <?php foreach($v['options'] as $option){ $option['notice'] = trim($option['notice']); ?>
                        <tr>
                            <td class="text-right" width="220">
                                <?php if($option['notice'] != ''){ ?>
                                    <a href="javascript:;" onclick="showNotice('notice_<?php echo $option['config_id'];?>')" title="点击此处查看提示信息"><i class="icon icon-question-sign"></i></a>
                                <?php } ?>
                                <?php echo $option['title'];?>
                                &nbsp;&nbsp;&nbsp;<a class="tabs-btn" href="<?php echo U('config/edit', array('config_id'=>$option['config_id'])); ?>" title="编辑设置"><i class="icon-edit"></i></a>
                                &nbsp;&nbsp;&nbsp;<a class="tabs-btn del" href="<?php echo U('config/del', array('config_id'=>$option['config_id'])); ?>" title="删除设置" onclick="javascript:if(confirm('确认删除？')){return true;}else{return false;}"><i class="icon-trash"></i></a>
                            </td>
                            <td class="mySelect">
                                <?php echo $option['option']; ?>
                                <?php if($option['notice'] != ''){ ?>
                                    <br /><span class="notice" style="display:none;" id="notice_<?php echo $option['config_id'];?>"><?php echo $option['notice'];?></span>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            <?php } ?>
        </li>
        <?php $ix++; }}?>
    </ul>
    <div style="clear:both; height:3px;"></div>
    <button class="btn btn-success"><i class="icon-ok"></i> 提交</button>
</form>

<script type="text/javascript">
    function showNotice(id)
    {
        $('#'+id).toggle();
    }
</script>
<include file="Inc/html_footer" />